package com.wen.oop2;

public class pet {
    public String name;
    public int age;
//    无参构造
    public void shout(){
        System.out.println(name+"已经"+age+"岁啦，他叫了一声");
    }
}
/*    public static void main(String[] args) {
//        实例化了一个对象
        pet dog = new pet();
        dog.name="旺财";
        dog.age=3;
        dog.shout();//这样就可以打印
        System.out.println(dog.age);
        pet cat = new pet();

    }*/